import request from '@/config/axios'

// 企业员工 VO
export interface CompanyEmployeeVO {
  id: number // 唯一ID
  companyId: number // 关联企业ID
  postId: number // 岗位ID
  name: string // 姓名
  phone: string // 手机号
  img: string // 头像
  openid: string // 联系人电话
  score: number // 积分
}

// 企业员工 API
export const CompanyEmployeeApi = {
  // 查询企业员工分页
  getCompanyEmployeePage: async (params: any) => {
    return await request.get({ url: `/dlbz/company-employee/page`, params })
  },

  // 查询企业员工详情
  getCompanyEmployee: async (id: number) => {
    return await request.get({ url: `/dlbz/company-employee/get?id=` + id })
  },

  // 新增企业员工
  createCompanyEmployee: async (data: CompanyEmployeeVO) => {
    return await request.post({ url: `/dlbz/company-employee/create`, data })
  },

  // 修改企业员工
  updateCompanyEmployee: async (data: CompanyEmployeeVO) => {
    return await request.put({ url: `/dlbz/company-employee/update`, data })
  },

  // 删除企业员工
  deleteCompanyEmployee: async (id: number) => {
    return await request.delete({ url: `/dlbz/company-employee/delete?id=` + id })
  },

  // 导出企业员工 Excel
  exportCompanyEmployee: async (params) => {
    return await request.download({ url: `/dlbz/company-employee/export-excel`, params })
  }
}